﻿<%if not in_sdcms then response.write("template load fail"):response.end() end if%><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="Keywords" content="{sdcms[seokey]}" />
<meta name="Description" content="{sdcms[seodesc]}" />
<title>在线留言_{sdcms[webname]} - powered by sdcms</title>
<link href="{webroot}lib/css/base.css" rel="stylesheet" type="text/css" />
<link href="{webroot}theme/default/css/public.css" rel="stylesheet" type="text/css" />
<link href="{webroot}theme/default/css/artlist.css" rel="stylesheet" type="text/css" />
<link href="{webroot}theme/default/css/book.css" rel="stylesheet" type="text/css" />
<script>var webroot="{webroot}";</script>
<script src="{webroot}lib/js/jquery.js"></script>
<script src="{webroot}lib/js/jquery-migrate-1.1.0.min.js"></script>
<script src="{webroot}lib/tips/jquery.tips.js"></script>
<script src="{webroot}lib/js/base.js"></script>
<script src="{webroot}lib/js/mobile.js"></script>
<script src="{webroot}lib/validator/jquery.validator.js"></script>
<script src="{webroot}lib/validator/zh_CN.js"></script>
<script src="{webroot}theme/default/js/sdcms.js"></script>
<script>
$(function()
{
	if($("#bookstaus").length>0)
	{
		$.ajax(
		{
			type:"post",
			cache:false,
			url:"?act=islogin",
			success:function(_){$("#bookstaus").html(_);}
		});
	}
	$(".form_book").validator(
	{
		stopOnError:true,
		theme:'yellow_top',
		ignore:':hidden',
		valid:function(form)
		{
			$.fn.tips({type:'loading',content:'数据提交中'});
			$.ajax(
			{
				url:"?act=add",
				type:"post",
				data:$(form).serialize(),
				success:function(data){
					data=jQuery.parseJSON(data);
					if(data.status!="y"){$.fn.tips({content:data.info});}
					if(data.status=="y")
					{
						var info=data.info.substring(1);
						$.fn.tips({type:"ok",content:info});
						$(".form_book")[0].reset();
						if(data.info.substring(0,1)==2){setTimeout(function(){location.href='?';},1500)}
					}
				}
			});
		}
	});
	//
})
</script>
</head>

<body>
    {sdcms:include("sdcms_head.asp")}
    
    <div id="position">
您所在的位置：<a href="{webroot}">首页</a> > 在线留言</div>
    <div class="w980 mt10 mc" id="container">
        <div class="left">
            <div class="w610 b">
                <div class="title">在线留言</div>
                
                {sdcms:rs field="avatar,username,createdate,content,reply" table="sd_expand_book" where="islock=1" order="id desc" pagesize="20" isadminurl="0"}
                {rs:eof}暂无留言{/rs:eof}
                <div class="book">
                    <div class="face"><img src="{webroot}upfile/avatar/{$rs[avatar]}/normal.jpg" /></div>
                    <div class="text">
                        <div class="div">
                            <div class="icon"></div>
                            <div class="base"><span>{$rs[createdate]}</span>{$rs[username]}</div>
                            <div class="content">{$rs[content]}</div>
                            {if sdcms.strlen($rs[reply])>0}<div class="reply"><strong>管理员回复：</strong>{$rs[reply]}</div>{/if}
                        </div>
                    </div>
                </div>
                {/sdcms:rs}
                <div class="list_page">{showpage}</div>
            </div>
            
            <div class="w610 b mt10">
                <div class="title">发表留言</div>
                    <form class="form_book" method="post">
                    <div class="bookadd">
                        <div class="label">昵称：<span>*</span></div>
                        <div class="enter" id="bookstaus"><input type="text" name="t0" id="nicekname" maxlength="20" data-rule="昵称:required;" class="ip" /></div>
                        <div class="label">留言内容：<span>*</span></div>
                        <div class="enter"><textarea name="t1" cols="55" rows="4" data-rule="留言内容:required;" class="ip" onKeyUp="strlen_verify(this,'booklen',255)" /></textarea><label>还可以输入<span id="booklen">255</span>个字符</label></div>
                        <div class="label">联系电话：<span>*</span></div>
                        <div class="enter"><input type="text" name="t2" maxlength="20" data-rule="联系电话:required;mobile|tel" class="ip" />　可以填写电话或手机，电话请加区号</div>
                        <div class="label">性别：</div>
                        <div class="enter"><select name="t3" id="sex"><option value="0">保密</option><option value="1">男</option><option value="2">女</option></select></div>
                        <div class="label">验证码：<span>*</span></div>
                        <div class="enter"><input type="text" name="t4" size="4" maxlength="4" data-rule="验证码:required;" class="ip" /> <img src="{webroot}lib/imgcode.asp?t0=80&t1=20" title="看不清楚？点击刷新！" align="absmiddle" id="imgcode" onClick="this.src+='&'+Math.random();" /></div>
                        <div class="label"></div>
                        <div class="enter"><input type="submit" value="提交" class="bnt" /> <input type="reset" value="重设" class="bnt" /></div>
                    </div>
                    </form>
            </div>
        </div>
        <div class="right">
            <div class="b">
                <div class="subject">热评话题</div>
                <ul class="toplist">
                    {sdcms:rs top="10" field="id,title,style,createdate,isurl,url,classid" table="sd_content" where="islock=1 and comments>0" order="comments desc,id desc"}
                    {rs:eof}<li>没有资料</li>{/rs:eof}
                    <li><a href="comment.asp?id={$rs[id]}" title="{$rs[title]}"{if $rs[isurl]=1} target="_blank"{/if} {$rs[style]}>{sdcms.cutstr($rs[title],30,1)}</a></li>
                    {/sdcms:rs}   
                </ul>
            </div>
            
            <div class="b mt10">
                <div class="subject">随机推荐</div>
                <ul class="toplist">
                    {sdcms:rs top="10" field="id,title,style,createdate,isurl,url,classid" table="sd_content" where="islock=1" order="rnd"}
                    {rs:eof}<li>没有资料</li>{/rs:eof}
                    <li><a href="{$rs[link]}" title="{$rs[title]}"{if $rs[isurl]=1} target="_blank"{/if} {$rs[style]}>{sdcms.cutstr($rs[title],30,1)}</a></li>
                    {/sdcms:rs}   
                </ul>
            </div>
            
        </div>
    </div>
    {sdcms:include("sdcms_foot.asp")}